package edu.aysf.service.fallback;

import edu.aysf.service.ClientOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ClientFallback implements FallbackFactory<ClientOrderService> {

    @Override
    public ClientOrderService create(Throwable cause) {
        return new ClientOrderService() {
            @Override
            public String echo(String string) {
                log.error("echo方法异常");
                return "echo方法异常";
            }

            @Override
            public String echo2(String string) {
                log.error("echo2方法异常");
                return "echo2方法异常";
            }

            @Override
            public String mycalc(int par1, int par2) {
                log.error("mycalc方法异常");
                return "mycalc方法异常";
            }
        };
    }
}
